<script src="<?php echo base_url();?>assets/js/ckeditor.js"></script>
			
			<div class="container">
				<div class="product-form">
				<div class="page-header" style="position:relative;">
					<h3>Detail Product</h3>
				</div>
                
                <ul class="nav nav-tabs" id="myTab">
                    <li class="active"><a href="#product">Product</a></li>
                    <li><a href="#shipping">Shipping</a></li>
                </ul>
        
                <div class="tab-content">
                    <div class="tab-pane active" id="product">
					<?php echo form_open('product/detail/'. $hasil->product_id,'class ="form-horizontal" ');?>
						<div class="control-group">
							<label class="control-label" for="product_name">Product Name</label>
							<div class="controls">
								<input id="product_name" type="text" name="product_name" value="<?php echo $hasil->product_name ?>" disabled class="input-xxlarge"/>
							</div>
						</div>
                        <hr>
                        <div class="control-group">
							<label class="control-label" for="product_name">Image</label>
							<div class="controls">
                            <?php if($hasil->image_file == NULL){ ?>
                                <img style="padding:3px; border:#666 1px solid; " width="80px" height="80px" src="/commerce/assets/img/no-image-100x100.png"/></td>
                            <?php }else{ ?>
                            	<img style="padding:3px; border:#666 1px solid; " width="80px" height="80px" src="/commerce/data/thumb/<?php echo $hasil -> image_file?>" />
                            <?php } ?>
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="description">Description</label>
							<div class="controls">
                            <div style="width:700px;float:left;">
								<textarea id="description" name="description" disabled class="ckeditor" ><?php echo $hasil->description ?></textarea>
                            </div>
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="price">Price</label>
							<div class="controls">
								<input id="price" type="text" name="price" value="<?php echo $hasil->price ?>" disabled class="input-medium"/>	
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="status">Status</label>
							<div class="controls">
								<select id="status" name="status" disabled>
									<?php if ($hasil->status) { ?>
										<option value="1" selected="selected">Enabled</option>
									  <option value="0">Disabled</option>
									 
									  <?php } else { ?>
									   <option value="1">Enabled</option>
									  <option value="0" selected="selected">Disabled</option>
									  <?php } ?>
								</select>
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="tags">Tags</label>
							<div class="controls">
								<input id="tags" type="text" name="tags" value="<?php echo $hasil->tags ?>" disabled class="input-xlarge"/>	
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="category">Category</label>
							<div class="controls">
								<!--<input id="category" type="text" name="category" value="<?php echo $hasil->category ?>" />	-->
                                <select name="category" disabled>
                                    <option disabled>- Category - </option>
                                        <?php foreach($cat as $r):?> 
                                            <option disabled value =<?php echo $r->category_id ?>
                                            	<?php if($hasil->category_id == $r->category_id) 
														echo ("selected=\"selected\"");?>> 
                                            <?php echo $r->category_name ?> </option>
                                        <?php endforeach ?>
								</select> 
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="option">Option</label>
                            <?php $option = $this->product_model->get_option($hasil->product_id); ?>
							<div class="controls">
                            <?php if(empty($option)){ ?>
								<input id="" type="text" name="" value="" disabled class="" placeholder="No Option.."/>
							<?php }else{ ?>
                            <table class="table table-bordered">
                            	<thead>
                                	<tr>
                                    	<th>Option Name</th>
                                        <th>Option Value</th>
                                        <th>Price</th>
                                        <th>Quantity</th>
                                        <th>Substract Stock</th>
                                    </tr>
                                </thead>
                                <tbody>
                                	<?php foreach($option as $keys => $opt){ ?>
                                    	<tr>
                                        	<td><?php echo $opt->option_name ?></td>
                                            <td><input id="option_value" type="text" name="option_value" value="<?php echo $opt->option_value ?>" disabled class=""/></td>
                                            <td><input id="price" type="text" name="price" value="<?php echo $opt->price ?>" disabled class="input-medium"/></td>
                                            <td><input id="quantity" type="text" name="quantity" value="<?php echo $opt->quantity ?>" disabled class="input-mini"/></td>
                                            <td><select name="subtract_stock" disabled="disabled" style="width:75px;">
                                                	<?php if ($opt->subtract_stock) { ?>
														<option disabled="disabled" value="1" selected="selected">Yes</option>
									  					<option disabled="disabled" value="0">No</option>
									  				<?php } else { ?>
									   					<option disabled="disabled" value="1">Yes</option>
									  					<option disabled="disabled" value="0" selected="selected">No</option>
									 				<?php } ?>
                                            	</select>
                                            </td>
										</tr>
									<?php } ?>
                                </tbody>
                            </table>
                            <?php } ?>
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="quantity">Quantity</label>
							<div class="controls">
								<input id="quantity" type="text" name="quantity" value="<?php echo $hasil->quantity ?>" disabled class="input-mini"/>
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="Weight">Weight</label>
							<div class="controls">
								<input id="weight" type="text" name="weight" value="<?php echo $hasil->weight ?>" disabled class="input-mini"/>
							</div>
						</div>
                        <hr>
                        <div class="control-group">
							<label class="control-label" for="Weight">Weight Class</label>
							<div class="controls">
								<select name="product_weight_class" disabled>
                                <?php $weightc = $this->product_model->weight_class(); ?>
                                    <option disabled>- Unit - </option>
                                        <?php foreach($weightc as $r):?> 
                                            <option disabled value =<?php echo $r->weight_class_id ?>
                                            	<?php if($hasil->weight_class == $r->weight_class_id) 
														echo ("selected=\"selected\"");?>> 
                                            <?php echo $r->title ?> </option>
                                        <?php endforeach ?>
								</select> 
							</div>
						</div>
                        <hr>
						<div class="control-group">
							<label class="control-label" for="height">Dimensions (L x W x H):</label>
							<div class="controls">
								<input id="height" type="text" name="length" disabled class="input-mini" placeholder="Length" value="<?php echo $hasil->length ?>"/> x
                                <input id="height" type="text" name="width" disabled class="input-mini" placeholder="Width" value="<?php echo $hasil->width ?>"/> x
                                <input id="height" type="text" name="height" disabled class="input-mini" placeholder="Height" value="<?php echo $hasil->height ?>"/> 
							</div>
						</div>
                        <hr />
                        <div class="control-group">
							<label class="control-label" for="height">Dimensions Class</label>
							<div class="controls">
                                <select name="product_length_class" disabled>
                                <?php $lengthc = $this->product_model->length_class(); ?>
                                    <option disabled>- Unit - </option>
                                        <?php foreach($lengthc as $r):?> 
                                            <option disabled value =<?php echo $r->length_class_id ?>
                                            	<?php if($hasil->length_class == $r->length_class_id) 
														echo ("selected=\"selected\"");?>> 
                                            <?php echo $r->title ?> </option>
                                        <?php endforeach ?>
								</select> 
							</div>
						</div>
                        <div class="form-actions">
							<!--<input class="btn btn-primary" id="submit" type="submit" value="Save Change" />-->
							<input class="btn" id="cancel" type="button" name="cancel" value="Back" onclick="self.history.back()" /> 
                        </div>
					<?php form_close();?>
                    </div>
                    <div class="tab-pane" id="shipping">
                    	<div id="shipping_data" style="margin:10px 0;">
                        	<?php if(empty($shipping_product)){
								echo "<table id='shipping_data_content' class='table table-striped'>
									<thead>
										<tr>
											<th>Shipping Method</th>
											<th>Area</th>
											<th>Cost</th>
										</tr>
									</thead>
								</table>";
							}else{
							?>
                            <table id="shipping_data_content" class='table table-striped'>
                            	<thead>
                                <tr>
                                    <th>Shipping Method</th>
                                    <th>Area</th>
                                    <th>Cost</th>
                                </tr>
                                </thead>
                
                                <?php foreach ($shipping_product as $val) { ?>
                
                                <tr id="<?php echo $val->shipping_id;?>">
                                    <td><?php echo $val->shipping_method; ?></td>
                                    <td><?php echo $val->location; ?></td>
                                    <td><?php echo $val->price; ?></td>
                                </tr>
                
                                <?php } ?>
                            </table>
                            <?php } ?>
                        </div>
                        <div class="form-actions">
							<!--<input class="btn btn-primary" id="submit" type="submit" value="Save Change" />-->
							<input class="btn" id="cancel" type="button" name="cancel" value="Back" onclick="self.history.back()" /> 
                        </div>
                    
                    </div>
                    </div>
				</div>
			</div>
 <script>
$(function () {
	$('#myTab a').click(function (e) {
		e.preventDefault();
		$(this).tab('show');
	});
});
</script>
        